// const { set } = require("lodash");

let obj = {
  name: 'lanpang',
  age: 18
}

let proxyObj = new Proxy(obj, {
  // target 就是Proxy代理的对象 也就是 obj
  // property 是当前访问的key
  set(target, property, value) {
    if(typeof value !== number) {
      throw new TypeError(`${value} is not a number`)
    }
  },
})

proxyObj.age = 111